<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>员工数据可视化</title>
    <!-- 引入ECharts库 -->
    <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.2.2/echarts.min.js"></script>
</head>
<body>
<!-- 为ECharts准备一个具备大小（宽高）的Dom -->
<div id="main1" style="width: 600px; height:400px;"></div>
<div id="main2" style="width: 600px; height:400px;"></div>
<div id="main3" style="width: 600px; height:400px;"></div>

<script>
    // 初始化ECharts实例
    var myChart1 = echarts.init(document.getElementById('main1'));
    var myChart2 = echarts.init(document.getElementById('main2'));
    var myChart3 = echarts.init(document.getElementById('main3'));

    // 配置图表选项和数据
    var option1 = {
        tooltip: {
            trigger: 'axis'
        },
        xAxis: {
            type: 'category',
            data: data.map(item => item.name)
        },
        yAxis: {
            type: 'value'
        },
        series: [{
            data: data.map(item => item.value),
            type: 'bar'
        }]
    };
    var option2 = {
        tooltip: {
            trigger: 'item'
        },
        legend: {
            orient: 'vertical',
            left: 'left'
        },
        series: [
            {
                name: '性别分布',
                type: 'pie',
                radius: '50%',
                data: data,
                emphasis: {
                    itemStyle: {
                        shadowBlur: 10,
                        shadowOffsetX: 0,
                        shadowColor: 'rgba(0, 0, 0, 0.5)'
                    }
                }
            }
        ]
    };
    var option3 = {
        xAxis: {
            type: 'time',
            splitLine: {
                show: false
            }
        },
        yAxis: {
            type: 'value',
            boundaryGap: [0, '30%']
        },
        series: [{
            data: jsonData.data,
            type: 'line',
            smooth: true
        }]
    };

    // 使用配置项和数据显示图表
    myChart1.setOption(option1);
    myChart2.setOption(option2);
    myChart3.setOption(option3);
</script>
</body>
</html>